import React from 'react';
import Monent from 'moment';

export default class CommitCommentInfo extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    const { comment } = this.props;
    const { created_at, author } = comment;
    const userName = author ? author.name : '';
    return (
      <div className="item-detail">
        <div className="name-time">
          <div className="user-name">
            <span className="comment-name">{userName}</span>
            <span className="comment-time">{Monent(created_at).format('YYYY-MM-DD HH:mm')}</span>
          </div>
        </div>
      </div>
    );
  }
}
